/*
 * @Author: Marshall
 * @Date: 2024-06-02 21:03:51
 * @LastEditors: Marshall
 * @LastEditTime: 2024-06-08 21:18:47
 * @Description:
 * @FilePath: /yudao-ui-admin-vue3/src/api/scenic/checkin/index.ts
 */
import request from '@/config/axios'

// 实践点打卡 VO
export interface CheckInVO {
  id: number // 自增主键
  memberId: number // 小程序用户id
  spotId: number // 实践点
  spotDeptId: number // 实践点部门id
}

// 实践点打卡 API
export const CheckInApi = {
  // 查询实践点打卡分页
  getCheckInPage: async (data: any) => {
    return await request.post({ url: `/scenic/check-in/check_in_page_by_location`, data })
  },

  // 查询实践点打卡详情
  getCheckIn: async (id: number) => {
    return await request.get({ url: `/scenic/check-in/get?id=` + id })
  },

  // 新增实践点打卡
  createCheckIn: async (data: CheckInVO) => {
    return await request.post({ url: `/scenic/check-in/create`, data })
  },

  // 修改实践点打卡
  updateCheckIn: async (data: CheckInVO) => {
    return await request.put({ url: `/scenic/check-in/update`, data })
  },

  // 删除实践点打卡
  deleteCheckIn: async (id: number) => {
    return await request.delete({ url: `/scenic/check-in/delete?id=` + id })
  },

  // 导出实践点打卡 Excel
  exportCheckIn: async (params) => {
    return await request.download({ url: `/scenic/check-in/export-excel`, params })
  }
}
